﻿@model YogaStudio.Data.Domain.Product

@{
    ViewBag.Title = "ProductDetails";
}

<div class="main">
    <div class="content">
        <div class="section group">
            <div class="col span_2_of_3">
                <div class="contact-form">
                    <p>
                        @if (TempData["Message"] != null)
                        {
                            <div style="color:green;" id="successMessage">@TempData["Message"]</div>
                            <script>
                                setInterval(function () {
                                    $("#successMessage").fadeOut("slow");
                                }, 2000);
                            </script>
                        }
                    </p>
                    <h3>Product Details</h3>

                     <img src="@Url.Content(Model.ImageUrl ?? "~/Content/Images/DefaultPicture.jpeg")" alt="Image Not Found" height="300" width="500" />
                    <table class="details">
                        <tr>
                            <td>Category</td>
                            <td>@Html.DisplayFor(model => model.Category.CategoryName)</td>
                        </tr>
                        <tr>
                            <td>Product Name</td>
                            <td>@Html.DisplayFor(model => model.ProductName)</td>
                        </tr>
                        <tr>
                            <td>Description</td>
                            <td>@Html.DisplayFor(model => model.Description)</td>
                        </tr>
                        <tr>
                            <td>Price</td>
                            <td>@string.Format("{0:C}", @Model.Price)</td>
                        </tr>
                    </table>
                </div>
                
                    @using (Html.BeginForm("AddToCart", "ShoppingCart" ))
                    {
                        <p>
                            @Html.Hidden("id", Model.ProductId)
                            <input type="submit" value="Add to Cart" class="btn btn-default" />
                        </p>
                    }
                
                <br />
                <br />
                
            </div>
        </div>
    </div>
</div>
